package com.han.cloud.controller;

import com.han.cloud.dto.TradeDTO;
import com.han.cloud.dto.WrapperResponse;
import com.han.cloud.service.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author hanky
 * @date 2021/11/12
 */
@RestController
@Slf4j
public class HytrixPaymentController {
    @Resource
    private PaymentService paymentService;

    @GetMapping("/getTrade1")
    public WrapperResponse<TradeDTO> getTrade1(String id){
        TradeDTO res = paymentService.getTrade1(id);
        return WrapperResponse.success(res);
    }

    @GetMapping("/getTrade2")
    public WrapperResponse<TradeDTO> getTrade2(String id){
        TradeDTO res = paymentService.getTrade2(id);
        return WrapperResponse.success(res);
    }
}
